package exam13;

/**
 * @author HB
 * @version 1.0
 * @description
 * @date 2021/7/2
 */
public class BubbleSort implements Sort{
    @Override
    public int[] sort(int arr[]){
        for(int i=0;i< arr.length;i++){
            for(int j=i;j<arr.length;j++){
                if(arr[j]<arr[i]){
                    arr[i]=arr[i]^arr[j];
                    arr[j]=arr[i]^arr[j];
                    arr[i]=arr[i]^arr[j];
                }

            }
        }
        System.out.println("冒泡排序");
        return arr;
    }
}

